package com.jash.labor.controller;

import com.jash.labor.entity.FirstParty;
import com.jash.labor.entity.StationFav;
import com.jash.labor.service.FirstPartyService;
import com.jash.labor.service.StationFavService;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.awt.*;
import java.util.Date;

@RestController
@RequestMapping(value = "/stationFav",produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public class StationFavController {
    @Resource
    private StationFavService stationFavService;

    @RequestMapping(value = "/add")
    public Object add(
            @RequestBody StationFav stationFav
            /*@RequestParam(value = "id") Integer id,
            @RequestParam(value = "stationId") Integer stationId,
            @RequestParam(value = "laborId") Integer laborId*/
    ){

        return stationFavService.add(stationFav);
    }

    @RequestMapping(value = "/edit")
    public Object edit(
            @RequestBody StationFav stationFav
    ){

        return stationFavService.edit(stationFav);
    }

    @RequestMapping(value = "/queryListPage")
    public Object queryListPage(
            @RequestParam(value = "id") Integer id,
            //出现问题删除上一行及其相关；
            @RequestParam(value = "pageNo",required = false) Integer pageNo,
            @RequestParam(value = "pageSize",required = false,defaultValue = "10") Integer pageSize
    ){
        return stationFavService.laborQueryStationFavList(id,pageNo,pageSize);
        //上面那行删掉后记得把这里的id删掉；
    }
    @RequestMapping(value = "/laborQueryStationFavList")
    public Object laborQueryStationFavList(
            @RequestParam(value = "company_id") Integer company_id,
            //出现问题删除上一行及其相关；
            @RequestParam(value = "pageNo",required = false) Integer pageNo,
            @RequestParam(value = "pageSize",required = false,defaultValue = "10") Integer pageSize
    ){
        return stationFavService.laborQueryStationFavList(company_id,pageNo,pageSize);
        //上面那行删掉后记得把这里的id删掉；
    }
}
